package com.yyc.bleem.service;

import com.yyc.bleem.common.utils.ResponseUtil;
import com.yyc.bleem.feignclient.MicroProviderClient;
import com.yyc.bleem.pojo.entity.ResponseEntity;
import org.springframework.stereotype.Service;

/**
 * 用户信息服务层
 * @author yyc
 */
@Service
public class UserService {

    private final MicroProviderClient microProviderClient;

    public UserService(MicroProviderClient microProviderClient) {
        this.microProviderClient = microProviderClient;
    }

    /**
     * 获取到的数据处理
     * @return  ResponseEntity<Integer> 获取到的数据
     */
    public ResponseEntity<Object> searchPage(){
        ResponseEntity<Object> responseEntity = microProviderClient.searchPage();
        if(responseEntity.getSuccessFlag()){
            return responseEntity;
        }else{
            return ResponseUtil.createErrorResult(null,responseEntity.getMessage());
        }

    }
}
